package com.testfileupload.uploadimg.design.adapter.define;

import com.testfileupload.uploadimg.design.adapter.IUserInfo;

import java.util.Map;
//适配器
public class OuterUserInfo implements IUserInfo {
    //源目标信息
    private IOuterUserBaseInfo baseInfo =null;
    private IOuterUserHomeInfo homeInfo =null;
    private IOuterOfficeInfo officeInfo = null;
    //数据处理
    private Map baseMap = null;
    private Map homeMap = null;
    private Map officeMap = null;

    public OuterUserInfo(IOuterUserBaseInfo baseInfo, IOuterUserHomeInfo homeInfo, IOuterOfficeInfo officeInfo) {
        this.baseInfo = baseInfo;
        this.homeInfo = homeInfo;
        this.officeInfo = officeInfo;
        //数据处理
        this.baseMap = this.baseInfo.getUserBaseInfo();
        this.homeMap = this.homeInfo.getUserHomeInfo();
        this.officeMap = this.officeInfo.getOfficeInfo();
    }

    @Override
    public String getUserName() {
        return (String) this.baseMap.get("username");
    }

    @Override
    public String getHomeAddress() {
        String homeAddress = (String) this.homeMap.get("homeAddress");
        return homeAddress;
    }

    @Override
    public String getMobileNumber() {
        String mobilNumber = (String) this.baseMap.get("mobilNumber");
        return mobilNumber;
    }

    @Override
    public String getOfficeTelNum() {
        String officeNum = (String) this.officeMap.get("officeNum");
        return officeNum;
    }

    @Override
    public String getJobPosition() {
        String jobposition = (String) this.officeMap.get("jobposition");
        return jobposition;
    }

    @Override
    public String getHomeTelNum() {
        String homeTelNum = (String) this.officeMap.get("homeTelNum");
        return homeTelNum;
    }
}
